package fr.vahren.sriksal.generation;

public class Drop {

	private int capacity;


	public Drop(int capactity) {
		this.setCapacity(capactity);
		soil=0;
	}

	private Position position;

	/**
	 * @return the position
	 */
	public Position getPosition() {
		return position;
	}

	/**
	 * @param position
	 *            the position to set
	 */
	public void setPosition(Position position) {
		this.position = position;
	}

	/**
	 * @return the soil
	 */
	public int getSoil() {
		return soil;
	}

	/**
	 * @param soil
	 *            the soil to set
	 */
	public void setSoil(int soil) {
		this.soil = soil;
	}

	private int soil;

	public void addSoil(int qty) {
		soil = Math.min(capacity, qty+soil);
	}

	public boolean isFull(int dropCapacity) {
		return soil >= dropCapacity;
	}

	public int getCapacity() {
		return capacity;
	}

	public void setCapacity(int capacity) {
		this.capacity = capacity;
	}

	@Override
	public String toString() {
		return position.toString();
	}

}
